package cn.wsalix.msg.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.anlaser.entity.CommonEntity;

/**
 * @author jskyme
 * 问题、主题，驱动聊天记录
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "ISSUE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@Data
@EqualsAndHashCode(exclude = {}, callSuper = false)
@ToString(exclude = {})
public class Issue extends CommonEntity {

	private String content;
	private Long presbyterId;//发起人Id
	private String presbyter;//发起人
	@Temporal(TemporalType.TIMESTAMP)
	private Date sendTime;
	private Long fkId;//外键：产品ID等
	private Long waiterId;//外键：产品ID等
	private String waiterName;
/*	@JsonIgnore
	@ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "SENDER_ID")
	private SysUser sender;// 接收者
	
	@JsonIgnore
	@ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "SENDEE_ID")
	private SysUser sendee;// 接收者
	private boolean readed;*/
}